package cn.edu.njuit.springbootdemo.controller;

import cn.edu.njuit.springbootdemo.javabean.Article;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class ConverterController {
    //接收字符串转化为对象，然后把对象⼜转化为字符串输出
    @RequestMapping(value = "/convert", produces = {"application/vnd.ms-excel"})
    public @ResponseBody Article convert() {
        Article result = Article.builder().id(1L).title("年均财富增长110% " +
                "马斯克有望成史上第一个万亿富翁").build();
        return result;
    }
}
